package org.minos.edit.controller
{
	import flash.events.Event;
	import flash.filesystem.File;
	import org.aswing.JLabel;
	import org.ichow.debug.Debug;
	import org.minos.edit.controller.manager.FileManager;
	import org.minos.edit.EditFacate;
	import org.minos.edit.model.AssetsProxy;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * 选择课程根目录方法
	 * @author Minos
	 */
	public class SelectPathCommand extends SimpleCommand
	{
		
		override public function execute( notification : INotification ) : void
		{
			super.execute( notification );
			if ( !notification.getBody() )
				return;
			//测试路径
			var path : String = "E:/work/情境教学/SceneCourseWare/bin";
			//浏览目录
			FileManager.browseForDirectory( FileManager.getFile( "root" , path , true ) , callback , "选择课程目录" );
			function callback( file : Object = null ) : void
			{
				if ( !file )
					return;
				Debug.log( file.nativePath , this );
				var o : Object = notification.getBody();
				if ( o && o.tf )
				{
					o.tf.setText( file.nativePath );
					o.tf.updateUI();
				}
				//获取
				AssetsProxy( facade.retrieveProxy( AssetsProxy.NAME ) ).getAssets( file as File );
			}
		}
	
	}

}